notebook: Don't needlessly cast in macros
authorBenjamin Otte <otte@redhat.com>
Sat, 5 Sep 2015 20:36:20 +0000 (22:36 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 7 Sep 2015 12:33:50 +0000 (14:33 +0200)
That way we disable typechecks done by the compiler and won't notice
when we pass the wrong values to the macro. And that's bad.

gtk/gtknotebook.c

index 8046bf3ee34e275da3a00e4cbaa606ffededaa60..3cade7fd342f1f2836bc2b2afcf27a8739d16c96 100644 (file)
@@ -238,12 +238,12 @@ enum {
   CHILD_PROP_DETACHABLE
 };
 
-#define GTK_NOTEBOOK_PAGE(_glist_)         ((GtkNotebookPage *)((GList *)(_glist_))->data)
+#define GTK_NOTEBOOK_PAGE(_glist_)         ((GtkNotebookPage *)(_glist_)->data)
 
 /* some useful defines for calculating coords */
-#define PAGE_MIDDLE_X(_page_) (((GtkNotebookPage *) (_page_))->allocation.x + ((GtkNotebookPage *) (_page_))->allocation.width / 2)
-#define PAGE_MIDDLE_Y(_page_) (((GtkNotebookPage *) (_page_))->allocation.y + ((GtkNotebookPage *) (_page_))->allocation.height / 2)
-#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) (gtk_widget_get_parent (((GtkNotebookPage *) (_page_))->tab_label) == ((GtkWidget *) (_notebook_)))
+#define PAGE_MIDDLE_X(_page_) ((_page_)->allocation.x + (_page_)->allocation.width / 2)
+#define PAGE_MIDDLE_Y(_page_) ((_page_)->allocation.y + (_page_)->allocation.height / 2)
+#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) (gtk_widget_get_parent ((_page_)->tab_label) == (GTK_WIDGET (_notebook_)))
 
 struct _GtkNotebookPage
 {